package cn.itcast.demo2;

public class TestSrudent {
    public static void main(String[] args) {
        //格式一：通过无参构造实现
        cn.itcast.demo2.Student stu= new cn.itcast.demo2.Student();
        //stu.name="yumu";
        stu.setName("雨木");
        stu.setAge(21);


        System.out.println(stu.getName());
        System.out.println(stu.getAge());

        //格式二：通过构造方法实现快速初始化
        cn.itcast.demo2.Student stu2=new Student("雨木",21);
        System.out.println(stu2.getName());
        System.out.println(stu2.getAge());
    }

}
